<template>
  <div class="warpper">
    <div class="left-side">
      <div class="left-music-list" v-for="(item, index) in menuList" :key="index">
        <div class="parent-color">{{ item.text }}</div>
        <router-link to="" v-for="(item1, index1) in item.list" :key="index1" class="children-color music-list-item">
          <div @click="fn(item1, index1)" class="w-100t">
            <i :class="'iconfont ' + item1.icon"></i>
            {{ item1.describe }}
          </div>
        </router-link>
      </div>
    </div>
    <div class="main-connt">
      <!-- mains -->
      <router-view :key="key"></router-view>
    </div>
    <div class="foot">
      <aplayer :music="musics[0]" :list="musics" :showlrc="true" class="aplayer-box"></aplayer>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import aplayer from 'vue-aplayer'
import ag from '@/assets/music/姚贝娜 - 战争世界.mp3'
export default {
  components: { aplayer },
  data() {
    return {
      menuList: {
        // 推荐
        recommend: {
          text: '推荐',
          list: [
            {
              describe: '猜你喜欢',
              icon: 'icon-xiaosuolvetu',
            },
            {
              describe: '歌曲搜索',
              icon: 'icon-sousuo',
            },
          ],
        },
        // 我的音乐
        myMusic: {
          text: '我的音乐',
          list: [
            {
              describe: '我的收藏',
              icon: 'icon-shoucang1',
            },
            {
              describe: '我的电台',
              icon: 'icon-diantaizhibo',
            },
            {
              describe: '本地与下载',
              icon: 'icon-xiazai',
            },
            {
              describe: '音乐云盘',
              icon: 'icon-yun-yunpan-yuncunchu',
            },
            {
              describe: '最近播放',
              icon: 'icon-lishijilu',
            },
            {
              describe: '默认列表',
              icon: 'icon-bofangliebiao',
            },
          ],
        },
        // 主题
        theme: {
          text: '主题',
          list: [
            {
              describe: '主题',
              icon: 'icon-zhuti',
            },
          ],
        },
        // 自定义歌单
        customSongList: {
          text: '自建歌单',
          list: [
            // {
            //   describe: '自建歌单',
            //   icon: ';'
            // },
          ],
        },
      },
      musics: [{ title: '战争世界', artist: '姚贝娜', url: ag }],
    }
  },
  computed: {
    ...mapState(['userlist']),
    key() {
      return this.$route.fullPath
    },
  },

  methods: {
    fn(item1, index1) {
      console.log(item1, index1, '点击了=========' + item1.describe)
    },
  },
  mounted() { },
  watch: {},
}
</script>

<style scoped lang="less">
// 公共部分
.parent-color {
  color: rgb(113 119 144 / 78%);
  margin-bottom: 14px;
}

.children-color {
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: #555;
}

.warpper {
  display: flex;
  flex-grow: 1;
  font-size: 14px;
  overflow: hidden;

  .left-side {
    width: 200px;
    border-right: 1px solid rgba(113 119 144 / 25%);
    padding: 26px 10px 30px 26px;

    // overflow: auto;
    .left-music-list {
      box-sizing: border-box;
      margin: 0 0 20px;

      .music-list-item {
        display: flex;
        padding: 12px;
        align-items: center;
        text-decoration: none;

        .w-100t {
          width: 100%;
        }

        i {
          padding-right: 8px;
        }

        &:hover {
          background: rgb(12 15 25 / 30%);
          border-radius: 5px;
        }
      }
    }
  }

  .main-connt {
    width: 100%;
    margin: 0;
    padding: 0;
    flex: 14;
    // overflow: auto;
  }

  .foot {
    flex: 1;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 999;

    .aplayer-box {
      margin: 1px 0;
      border-radius: 0 0 8px 8px;
    }
  }
}</style>
